﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BlockEngine.World.Renderer
{
    class Chunk
    {
        private Cube CubeRenderer = new Cube();
        public byte ChunkSize = World.Chunk.ChunkSize;
        public void Render(Engine.Internal.Point3D Position, short[,,] Blocks, bool RenderOnly)
        {
            for (int fx = 0; fx != ChunkSize; fx++) {
                for (int fy = 0; fy != ChunkSize; fy++) {
                    for (int fz = 0; fz != ChunkSize; fz++)
                    {
                        CubeRenderer.Render(new Engine.Internal.Point3D(fx + ((Position.X + 1) * (ChunkSize)), fy + ((Position.Y + 1) * (ChunkSize)), fz + ((Position.Z + 1) * (ChunkSize))), Blocks[fx, fy, fz], RenderOnly);
                    }
                }
            }
        }
    }
}
